]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Work around introspection issue
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Aug 2025 06:04:30 +0000 (08:04 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 7 Aug 2025 07:50:40 +0000 (07:50 +0000)
Methods of all classes from GioUnix erroneously show up as static
methods, see https://gitlab.gnome.org/GNOME/glib/-/issues/3744.

Work around this by defining the methods ourselves if we detect
that case.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3801>

js/ui/environment.js

index 77f09bf10cbe7955a1c73638bfda007d8e4e410c..bbbdf1d31d1a9293cbae716e9e0e9e7001050723 100644 (file)
@@ -8,6 +8,7 @@ import Cairo from 'cairo';
 import Clutter from 'gi://Clutter';
 import Gdk from 'gi://Gdk';
 import Gio from 'gi://Gio';
+import GioUnix from 'gi://GioUnix';
 import GLib from 'gi://GLib';
 import GObject from 'gi://GObject';
 import Meta from 'gi://Meta';
@@ -340,6 +341,17 @@ Object.prototype.toString = function () {
     }
 };
 
+// Work around https://gitlab.gnome.org/GNOME/glib/-/issues/3744
+if (!GioUnix.DesktopAppInfo.prototype.has_key) {
+    GioUnix.DesktopAppInfo.prototype.has_key = function (key) {
+        return GioUnix.DesktopAppInfo.has_key(this, key);
+    };
+
+    GioUnix.DesktopAppInfo.prototype.get_categories = function () {
+        return GioUnix.DesktopAppInfo.get_categories(this);
+    };
+}
+
 const slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');
 if (slowdownEnv) {
     let factor = parseFloat(slowdownEnv);